package com.hsylient.canal.config;

import com.alibaba.otter.canal.client.CanalConnector;
import com.alibaba.otter.canal.client.CanalConnectors;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.net.InetSocketAddress;

@Configuration
public class CanalClientConfig {

    @Bean
    public CanalConnector canalConnector() {
        // 创建单机模式的Canal连接器
        return CanalConnectors.newSingleConnector(new InetSocketAddress("127.0.0.1", 11111),
                                                  "example", 
                                                  "",
                                                  "");
    }
}
